package com.dong.containerEx;

import org.springframework.beans.factory.InitializingBean;

import javax.annotation.PostConstruct;

/**
 * description
 *
 * @author Administrator 2021/08/30 18:55
 */
public class User implements InitializingBean {

    private String name;

    public User() {
        System.out.println("构造函数");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void init(){
        System.out.println("init-method");
    }

    @PostConstruct
    public void postConstruct(){
        System.out.println("postConstruct");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("InitializingBean:afterPropertiesSet");
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                '}';
    }
}
